load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "kvtenant",
    srcs = [
        "connector.go",
        "connector_factory.go",
        "setting_overrides.go",
        "test_utils.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvtenant",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config",
        "//pkg/config/zonepb",
        "//pkg/gossip",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/kv/kvclient/rangecache",
        "//pkg/kv/kvpb",
        "//pkg/multitenant/mtinfopb",
        "//pkg/multitenant/tenantcapabilities",
        "//pkg/multitenant/tenantcapabilities/tenantcapabilitiespb",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/rpc/nodedialer",
        "//pkg/server/serverpb",
        "//pkg/server/settingswatcher",
        "//pkg/settings",
        "//pkg/spanconfig",
        "//pkg/sql/isql",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/ts/tspb",
        "//pkg/util/grpcutil",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/rangedesc",
        "//pkg/util/retry",
        "//pkg/util/syncutil",
        "//pkg/util/syncutil/singleflight",
        "//pkg/util/timeutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//errorspb",
        "@org_golang_google_grpc//:go_default_library",
        "@org_golang_google_grpc//codes",
        "@org_golang_google_grpc//status",
    ],
)

go_test(
    name = "kvtenant_test",
    srcs = [
        "connector_test.go",
        "main_test.go",
        "setting_overrides_test.go",
        "tenant_kv_test.go",
        "tenant_range_lookup_test.go",
        "tenant_scan_range_descriptors_test.go",
        "tenant_trace_test.go",
    ],
    embed = [":kvtenant"],
    deps = [
        "//pkg/base",
        "//pkg/config",
        "//pkg/gossip",
        "//pkg/keys",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/kv/kvclient/rangecache",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/kv/kvserver/load",
        "//pkg/multitenant/mtinfopb",
        "//pkg/multitenant/tenantcapabilities/tenantcapabilitiespb",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/settings",
        "//pkg/sql",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/netutil",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/rangedesc",
        "//pkg/util/retry",
        "//pkg/util/stop",
        "//pkg/util/tracing/tracingpb",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
        "@org_golang_google_grpc//codes",
        "@org_golang_google_grpc//status",
    ],
)
